﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.Controls;
using Silvermoon.OpenGL;
using System.Drawing;

namespace Silvermoon.Windows.Styles
{
    public class NameValueItemStyle : Style
    {
        public Alignment? Alignment { get; set; }
        public Margin Padding { get; set; }
        public bool? AutoHeight { get; set; }
        public FontSprite NameFont { get; set; }
        public FontSprite ValueFont { get; set; }
        public Color? NameColor { get; set; }
        public float? NameFontScaleFactor { get; set; }

        public override void Apply(Silvermoon.Controls.Control c)
        {
            base.Apply(c);
            NameValueItem item = c as NameValueItem;
            if (item != null)
            {
                if (Alignment != null) item.Alignment = Alignment.Value;
                if (AutoHeight != null) item.AutoHeight = AutoHeight.Value;
                if (NameFont != null) item.NameFont = NameFont;
                if (ValueFont != null) item.ValueFont = ValueFont;
                if (NameColor != null) item.NameColor = NameColor.Value;
                if (NameFontScaleFactor != null) item.NameFontScale = NameFontScaleFactor.Value;
                if (Padding != null) item.Padding = Padding.Clone();
            }
        }
    }
}
